import React from "react";
import { Outlet } from "react-router-dom";
import useNavPage from "../hooks/useNavPage";
import useGetUserData from "../hooks/useGetuserData";
import { Spin } from "antd";

export default function QuestionLaout() {
  // 记载用户信息
  const { waitingUserData } = useGetUserData();
  // 页面跳转
  useNavPage(waitingUserData);
  return (
      <div style={{height:'100vh' , backgroundColor : 'pink'}}>
        {waitingUserData ? (
          <div style={{ marginTop: "60px", textAlign: "center" }}>
            <Spin />
          </div>
        ) : (
          <Outlet />
        )}
      </div>
  );
}
